package com.alivc.testmediaplayer;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;

import com.alivc.player.AliVcMediaPlayer;
import com.alivc.player.MediaPlayer;
import com.alivc.testmediaplayer.activity.CopyRightActivity;
import com.alivc.testmediaplayer.activity.DemoDiagnosisiActivity;
import com.alivc.testmediaplayer.activity.DemoUrlActivity;
import com.alivc.testmediaplayer.activity.ListModeActivity;
import com.alivc.testmediaplayer.utils.CleanLeakUtils;


public class DemoMainActivity extends AppCompatActivity {

    private int STORAGE_REQUEST_CODE = 100;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_demo_main);

        findViewById(R.id.authinfo).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.putExtra("type" , "vod");
                intent.setClass(DemoMainActivity.this, DemoUrlActivity.class);
                startActivity(intent);
            }
        });

        findViewById(R.id.live).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.putExtra("type" , "live");
                intent.setClass(DemoMainActivity.this, DemoUrlActivity.class);
                startActivity(intent);
            }
        });

        findViewById(R.id.player_list).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(DemoMainActivity.this, ListModeActivity.class);
                startActivity(intent);
            }
        });

        findViewById(R.id.web_diagnosis).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(DemoMainActivity.this, DemoDiagnosisiActivity.class);
                startActivity(intent);
            }
        });
        findViewById(R.id.copy_right).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(DemoMainActivity.this, CopyRightActivity.class);
                startActivity(intent);
            }
        });


        ((TextView)findViewById(R.id.version)).setText("v"+MediaPlayer.VERSION_ID);
    }


    @Override
    protected void onDestroy() {
        CleanLeakUtils.fixInputMethodManagerLeak(this);
        super.onDestroy();
    }
}
